﻿<%@ Page Language="C#" MasterPageFile="~/aspnet/admin/ForValidation.master" AutoEventWireup="true" CodeFile="Cx_Doctor_class.aspx.cs" Inherits="aspnet_admin_bock_Cx_GBookDoctorclass" Title="添加新科室" %>
<%@ Register Assembly="web表单验证控件" Namespace="CheckForm" TagPrefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder2" Runat="Server">
    &nbsp;
    <table align="center" border="0" cellpadding="2" cellspacing="1" class="border"
        height="116" width="100%">
        <tr align="center">
            <td class="topbg" colspan="2" style="height: 30px">
                <strong>添加新类别</strong></td>
        </tr>
        <tr>
            <td class="tdbg" colspan="2" style="height: 27px">
                提示信息:<asp:Label ID="tt" runat="server" CssClass="font-4"></asp:Label></td>
        </tr>
        <tr>
            <td class="tdbg" style="height: 27px" width="223">
                添加新科室分类名称:(50字以内)</td>
            <td class="tdbg" style="height: 27px; width: 787px;">
                <asp:TextBox ID="CX_Doctor_Class_Name" runat="server" MaxLength="50"></asp:TextBox></td>
        </tr>
        <tr>
            <td class="tdbg" colspan="2" style="height: 27px">
                <center>
                    <asp:Button ID="Button1" runat="server" Text="确定" OnClick="Button1_Click" /></center>
            </td>
        </tr>
    </table>
    <br />
    <asp:GridView id="GridView1" runat="server" CssClass="border" AllowPaging="True" PageSize="200" CellPadding="3" EmptyDataText="还没有科室分类" Width="100%" AllowSorting="True" AutoGenerateColumns="False" DataKeyNames="CX_Doctor_Class_id"
 DataSourceID="SqlDataSource1"><Columns>
        <asp:BoundField DataField="CX_Doctor_Class_id" HeaderText="科室分类编号" InsertVisible="False"
            ReadOnly="True" SortExpression="CX_Doctor_Class_id" >
            <ItemStyle CssClass="tdbg" />
            <HeaderStyle CssClass="topbg" Height="30px" HorizontalAlign="Center" />
        </asp:BoundField>
        <asp:BoundField DataField="CX_Doctor_Class_Name" HeaderText="科室分类名" SortExpression="CX_Doctor_Class_Name" >
                    <ItemStyle CssClass="tdbg" />
            <HeaderStyle CssClass="topbg" Height="30px" HorizontalAlign="Center" />
        </asp:BoundField>
        <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" >
                            <ItemStyle CssClass="tdbg" />
            <HeaderStyle CssClass="topbg" Height="30px" HorizontalAlign="Center" />
        </asp:CommandField>
</Columns>

<PagerStyle CssClass="tdbg" HorizontalAlign="Center" Font-Size="9pt" Font-Underline="False"></PagerStyle>
</asp:GridView>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConflictDetection="CompareAllValues"
        ConnectionString="<%$ ConnectionStrings:SqlConn %>" DeleteCommand="DELETE FROM [CX_Doctor_Class] WHERE [CX_Doctor_Class_id] = @original_CX_Doctor_Class_id AND [CX_Doctor_Class_Name] = @original_CX_Doctor_Class_Name"
        InsertCommand="INSERT INTO [CX_Doctor_Class] ([CX_Doctor_Class_Name]) VALUES (@CX_Doctor_Class_Name)"
        OldValuesParameterFormatString="original_{0}" SelectCommand="SELECT CX_Doctor_Class_id, CX_Doctor_Class_Name FROM CX_Doctor_Class"
        UpdateCommand="UPDATE [CX_Doctor_Class] SET [CX_Doctor_Class_Name] = @CX_Doctor_Class_Name WHERE [CX_Doctor_Class_id] = @original_CX_Doctor_Class_id AND [CX_Doctor_Class_Name] = @original_CX_Doctor_Class_Name">
        <DeleteParameters>
            <asp:Parameter Name="original_CX_Doctor_Class_id" Type="Decimal" />
            <asp:Parameter Name="original_CX_Doctor_Class_Name" Type="String" />
        </DeleteParameters>
        <UpdateParameters>
            <asp:Parameter Name="CX_Doctor_Class_Name" Type="String" />
            <asp:Parameter Name="original_CX_Doctor_Class_id" Type="Decimal" />
            <asp:Parameter Name="original_CX_Doctor_Class_Name" Type="String" />
        </UpdateParameters>
        <InsertParameters>
            <asp:Parameter Name="CX_Doctor_Class_Name" Type="String" />
        </InsertParameters>
    </asp:SqlDataSource>
</asp:Content>

